package cn.highset.modules.base.service.mybatis;

import cn.highset.modules.base.entity.City;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

/**
 * @author Victor
 */
@CacheConfig(cacheNames = "city")
public interface ICityService extends IService<City> {
    /**
     * 获取集合
     *
     * @return
     */
    @Cacheable(key = "'getlist:'+#provinceId")
    List<Map<String, Object>> list(String provinceId);

    /**
     * 通过id获取  名称
     *
     * @param cityId
     * @return
     */
    @Cacheable(key = "'getlabel:'+#cityId")
    String getLabelById(String cityId);

    /**
     * 通过id获取  名称
     *
     * @param label
     * @return
     */
    @Cacheable(key = "'getid:'+#label")
    String getIdByLabel(String label);
}
